package {
	
	import flash.display.Sprite;
	import flash.display.MovieClip;
	import flash.events.Event;
	import flash.events.MouseEvent;

	import com.tweenman.TweenMan;
	import fl.motion.easing.*;

	public class TweenManDemo3 extends Sprite {
		
		public function TweenManDemo3 () {
			stage.scaleMode = "noScale";
			var buttons = [btn1, btn2, btn3, btn4]; 
			for (var i=0; i<buttons.length; i++) {
				buttons[i].addEventListener(MouseEvent.ROLL_OVER, rollOverHandler);
				buttons[i].addEventListener(MouseEvent.ROLL_OUT, rollOutHandler);
			}
		}

		private function rollOverHandler (e:Event) {
			var button:MovieClip = MovieClip(e.target);
			TweenMan.addTween(button, { frames: 10, frame: button.totalFrames });
			TweenMan.addTween(button, { time: 2, blur: { blurX: 50 } });
		}
	
		private function rollOutHandler (e:Event) {
			var button:MovieClip = MovieClip(e.target);
			TweenMan.addTween(button, { frames: 20, frame: 1 });
			TweenMan.addTween(button, { time: 2, blur: null });
		}	
	}
}